﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using DevExpress.XtraEditors.Controls;
using DevExpress.XtraGrid;
using DevExpress.XtraGrid.Views.Grid;
using DevExpress.XtraEditors;
using MINERP.BLL.InfoConfig;
using MINERP.DAL;

namespace MINERP.InfoConfig.Controller
{
    public class PaperFaceController
    {
        #region //private fields

        private PaperFaceBLL _bll = new PaperFaceBLL();
        private GridControl     _grid = null;
        private GridView        _view = null;
        private ComboBoxEdit    _comboBox = null;
        private GroupControl    _groupControl = null;
        private CheckEdit       _checkEdit = null;

        #endregion


        #region //Public Properties

        internal GroupControl GroupControl
        {
            set
            {
                _groupControl = value;
            }
        }
        internal CheckEdit CheckEdit
        {
            set
            {
                _checkEdit = value;
            }
        }
        internal ComboBoxEdit ComoBox
        {
            set
            {
                _comboBox = value;
            }
        }
        internal GridControl Grid
        {
            set
            {
                _grid = value;
            }
        }

        internal GridView View
        {
            set
            {
                this._view = value;
            }
            get
            {
                return _view;
            }
        }

        #endregion

        #region //Public Methods

        /// <summary>
        /// Get Printers when the form loadding
        /// </summary>
        public void GetDate()
        {
            _grid.DataSource = _bll.GetPaperFaceList();
        }

        /// <summary>
        /// 添加纸面
        /// </summary>
        /// <param name="obj"></param>
        public void Add(paperFace obj)
        {
            _bll.Add(obj);
        }

        /// <summary>
        ///更新纸面
        /// </summary>
        /// <param name="obj"></param>
        public void Update(paperFace obj)
        {
            _bll.Update(obj);
        }
        /// <summary>
        /// 停用纸面
        /// </summary>
        /// <param name="obj"></param>
        public void Disable(paperFace obj)
        {
            _bll.disable(obj);
        }
        /// <summary>
        /// 启用纸面
        /// </summary>
        /// <param name="obj"></param>
        public void Useable(paperFace obj)
        {
            _bll.Useable(obj);
        }
        /// <summary>
        /// 删除纸面
        /// </summary>
        /// <param name="obj"></param>
        public void Delete(paperFace obj)
        {
            _bll.Delete(obj);
        }
        /// <summary>
        /// 得到纸面对象
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public paperFace GetPaperFaceObj(string name)
        {
            return  _bll.GetPaperFaceObj(name);
        }
        /// <summary>
        /// 得到纸面对象
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public paperFace GetPaperFaceObj(int id)
        {
            return _bll.GetPaperFaceObj(id);
        }
        #endregion
    }
}
